package kpi.javatraining6.gnatiuk.tests;

import kpi.javatraining6.gnatiuk.src.tester.Logger;
import org.junit.Before;
import org.junit.Test;

import java.io.IOException;

import static org.junit.Assert.*;

public class LoggerTest {
    Logger logger;
    @Before
    public void setUp() throws Exception {
        logger = Logger.getInstance();
    }

    @Test
    public void testGetLogger() throws Exception {
         assertEquals(Logger.class, Logger.getInstance().getClass());
    }

    @Test(expected = IOException.class)
    public void testRecordExceptionalEvent() throws Exception {
        try {
            throw new IOException();
        } catch (IOException e) {
            logger.recordExceptionalEvent(e);
            throw e;
        }
    }
}
